
<h3 class="h1">
	<b>管理文章</b>
	<span class="fr"><input id="opAdd" class="bt" type="button" value="添加文章"></span>
</h3>
<div class="admin_table mb10">
      <table width="100%">
         <tr class="tr2">
            <td>分类</td>
            <td>标题</td>
            <td>创建时间</td>
            <td>操作</td>
         </tr>
         <?php if (empty($this->articles)): ?>
         <tr class="tr3">
			<td colspan="4" class="td2">暂时没有文章</td>
         </tr>
         <?php endif; ?>
         <?php foreach ($this->articles as $item): ?>
         <tr class="tr3">
            <td class="td2"><?php echo $this->categories[$item['category_id']]; ?></td>
            <td class="td2"><?php echo $item['title']; ?></td>
            <td class="td2"><?php echo date('Y-m-d H:i', $item['create_at']); ?></td>
            <td class="td2">
            	<a href="<?php echo $this->url(array('action' => 'edit', 'id' => $item['id'])); ?>">编辑</a>
            	<a class="opDel" href="<?php echo $this->url(array('action' => 'delete', 'id' => $item['id'])); ?>">删除</a>
            </td>
         </tr>
         <?php endforeach; ?>
      </table>
</div>

<script>
$(document).ready(function() {
	$("#opAdd").click(function() {
		self.location.href = '<?php echo $this->url(array('action' => 'add')); ?>';
	});
	$("a.opDel").click(function() {
		return confirm('是否删除该文章？');
	});
});

</script>